The present invention generally relates to a method and an apparatus for converting the gray images inputted from image pickup elements, for example CCD camera, into binary images.
In order to analyze the shape of images, the gray images are normally changed with the binary images.
In order to make the binary images, a threshold value for the images is selected, and when the density of the pixel of the image is larger than the the threshold value, the pixel is white (or black), and the others are black (or white). When the same threshold value is applied with respect to the all pixels of the gray images, the shape information of the original gray images often becomes inappropriate in the conversion into the binary images.
This fact is because the density information of the gray images has normally 256 gradations, but that of the binary images has only two gradations. This is the reason why the shape information of the binary images becomes inappropriate to lose the shape information of gray images. In order to prevent such shape information loss, it is conventionally proposed that the processing of emphasizing the contrasts of the images should be effected before the binary processing or the way of the lighting should be devised to input the images into the image pickup elements.
But the converting the gray images into the binary images is often insufficient, even when the contrasts of the images are emphasized in processing or when the lighting is devised. A representative example in the application of the conventional binary processing will be described in FIG. 13.
In FIG. 13, the (a) is an abbreviated figure of the gray images inputted from the image pickup elements. The (b) thereof is a 1-dimensional density histogram in the X--X (horizontal). The (c), (d), (e) thereof are abbreviated figures showing the binary images when the respective threshold values are at the time of A, B, C.
It is found out from the embodiment of FIG. 13 that the shape information of the original gray images in the conventional binary processing is lost, so that it is not made binary images properly.
If the shape information of the binary images is not sufficient, it is found out that the analyses using the binary images do not become proper.